package com.guoxiaochen.springboot.dao;

import com.guoxiaochen.springboot.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;

@Repository
public interface UserDao extends JpaRepository<User, Integer> {
    @Query(value = "select * from user where name=:name and password=:password",nativeQuery = true)
    User findUserByUsernameAndPassword(String name, String password);

    @Query(value = "select * from user where name=:name",nativeQuery = true)
    User verifyAccount(String name);
}
